-- Decompiled with the Synapse X Luau decompiler.

local LocalPlayer = game:GetService("Players").LocalPlayer;
local ClientOHOH = _G.ClientOHOH;
local M = ClientOHOH.class.new(script);
local JsonHelper = ClientOHOH.load.JsonHelper();
local RemoteFunction = ClientOHOH:GetPath_Loop("ReplicatedStorage.RemoteFunction");

local function Number2String(data)
	if type(data) ~= "table" then
		return data;
	end;
	local v6 = {};
	for v7, v8 in pairs(data) do
		if type(v7) == "number" then
			v7 = tostring(v7);
		end;
		v6[v7] = Number2String(v8);
	end;
	return v6;
end;
local function String2Number(p2)
	if type(p2) ~= "table" then
		return p2;
	end;
	local v9 = {};
	for v10, v11 in pairs(p2) do
		--v9[tonumber(v10) and local v12] = String2Number(v11);
		v9[tonumber(v10) or v10] = String2Number(v11);

	end;
	return v9;
end;
local u4 = {};
local u5 = {};
local InstanceManager = ClientOHOH.load.InstanceManager();
local function u8(p3, p4, ...)
	local v13 = u4[p4];
	if not v13 or not (not u5[p4]) then
		return;
	end;
	u5[p4] = true;
	u5[p4] = nil;
	return table.unpack((String2Number((v13(p3, p4, ...)))));
end;
local u9 = {};
function RemoteFunction.OnClientInvoke(p5, ...)
	local v14 = InstanceManager:FindObject();
	if not v14 then
		u9[p5] = { ... };
		return;
	end;
	return u8(v14, p5, ...);
end;

function M.SetHandle(p6, p7, p8)
	assert(p7, "param function name is nil");
	assert(p8, "param handle is nil");
	u4[p7] = p8;
end;
local FUNC_TIME_DATA = {};
local player_dataex_helper = ClientOHOH.player_dataex_helper;
function M.Invoke(self, fuc, ...)
	local data = nil;
	if FUNC_TIME_DATA[fuc] then
		warn("function " .. fuc .. " is actived! pls wait");
		return;
	end;
	FUNC_TIME_DATA[fuc] = os.clock();
	
	local netData = {};
	for k, v in ipairs({ ... }) do
		netData[k] = Number2String(v);
	end;
	

	local encryptionData = player_dataex_helper:Encode(fuc, netData);
	
	
	local success = nil;
	success, data = xpcall(function()
		FUNC_TIME_DATA[fuc] = nil;
		return String2Number({ RemoteFunction:InvokeServer(encryptionData, table.unpack(netData)) });
	end, debug.traceback);
	if not success then
		warn(data);
		return;
	end;
	return table.unpack(data);
end;
function M.DelayGet(p11, p12)
	local v20, v21, v22 = ipairs(u9);
	local v23, v24 = v20(v21, v22);
	if not v23 then
		return;
	end;
	return u8(p12, v23, table.unpack(v24));
end;
return M;
